package com.example.demo.config;

import com.example.demo.udp.DemoUdpNettyClient;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

public class NettyClientSington {

    private static DemoUdpNettyClient nettyClient;

    public static ConfigurableListableBeanFactory  beanFactory;

//    private static String serverHost = "192.168.8.201";
//    private static String serverHost = "127.0.0.1";
    private static String serverHost = "255.255.255.255";
    private static int serverPort = 8888;
    private static int clientPort = 7777;

    public static DemoUdpNettyClient getNettyClient() throws InterruptedException {

//        String message = RandomUtil.randomString(1024);
        if (nettyClient == null){
            nettyClient = new DemoUdpNettyClient(serverHost, serverPort, clientPort);
            nettyClient.connect();
        }
        return nettyClient;
    }

}
